package serializabale;

import org.springframework.util.SerializationUtils;

/**
 * 序列化
 */
public class Test {
    public static void main(String[] args) {
        Person person = new Person();
        person.setName("cuihao");
        person.setAddress("回龙观");
        // 序列化
        byte[] p = SerializationUtils.serialize(person);
        // 反序列化
        Person per = (Person) SerializationUtils.deserialize(p);
        System.out.println(per);
    }
}
